export function promisify(fn) {
    return function(options) {
        return new Promise(function(resolve, reject) {
            const success = (result) => {
                resolve(result)
            }
            const error = (error) => {
                reject(error)
            }
            fn({
                ...options,
                success,
                error
            })

        })
    }
}